package com.first.orange.util;

import javax.servlet.http.HttpSession;


public class SendMessageUtil {
    public Boolean checkMessage(HttpSession httpSession) {
        //获取现在时间
        Long checkTime = System.currentTimeMillis();
        //从session中获取开始时间
        Long startTime = (Long) httpSession.getAttribute("start");
        //比较时间差异，查看是否超时
        if (checkTime - startTime > (5 * 60 * 10000)) {
            System.out.println("时间超过5min，请重新发送验证码");
            return false;
        }
        return true;
    }
}
